// components/infostream/infostream.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    stream: {
      type: String,
      value: '?'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    bottomTime: {
      type: Number,
      value: 0
    },
    cards: {
      type: Array,
      value: []
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    fetchData: function () {
      // TODO
    },
    repaint: function () {
      // TODO
    }
  },

  attached: function () {
    const fetchDistance = 15 * 24 * 60 * 60 * 1000;
    this.setData({
      bottomTime: Math.max(0, Date.now() - fetchDistance)
    });
  }
})
